<?php
$section = 'gallery';

$titre = _LB_GALLERY_MANAGEMENT;
$smarty->assign("titre", $titre);

Session::setBackLink($section);
$filter = array();
if(isset($_GET['STATUS'])){
    $filter["STATUS"] = Request::get('STATUS');
}
else{
    $filter["STATUS"] = 0;
}
$album = new Album();
$query = "SELECT ALBUM.*, COUNT(ALBUM_GALLERY.ID) NBR_PHOTO FROM ALBUM 
LEFT JOIN ALBUM_GALLERY ON ALBUM_GALLERY.ID_ALBUM = ALBUM.ID
GROUP BY ALBUM.ID ORDER BY ALBUM.ID DESC";
$args = array();
$pager = new  DBPager($album,$args, false ,PAGING_DEFAULT_ITEM_PER_PAGE,$query);
$album->query($query);
$cfer = new Cfer(array(
	_LB_ACCUEIL => Utils::getHomeLink(),
	_LB_GALLERY_MANAGEMENT => Utils::getCurrentLink()));
$smarty->assign('cfer', $cfer);
$smarty->assign('album', $album);
$smarty->assign('pager', $pager);
$smarty->assign('filter', $filter);
$smarty->display('gallery_album_list.html');